﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SimulacionAgrofoods
{
    public partial class Form1 : Form
    {
        Simulador simulador;
        
        public Form1()
        {
            InitializeComponent();

            simulador = new Simulador();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            if (dialog.ShowDialog() == DialogResult.OK)
            {

                simulador.Path = dialog.FileName;

                button2.Enabled = true;
            }


        }

        private void button2_Click(object sender, EventArgs e)
        {
            int a = (int)numericUpDown2.Value;

            simulador.simular((int)numericUpDown1.Value, a);

            

            button3.Enabled = true;
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button3_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog dialog = new FolderBrowserDialog();

            if (dialog.ShowDialog() == DialogResult.OK)
            {

                string path = dialog.SelectedPath;

                simulador.Exportar(path);
            }
        }

        private void numericUpDown1_ValueChanged(object sender, EventArgs e)
        {

        }
    }
}
